Assign Card to Customer
Cards
Assign Card to Customer
Attach a tokenized card to a Stripe customer
POST
Assign Card to Customer
Attaches a tokenized card (source) to an existing Stripe customer. The card becomes a payment method that can be used for future payments.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/peLuis123/Stripe_Back/llms.txt
Use this file to discover all available pages before exploring further.
You must first create a card token using the Create Card Token endpoint before assigning it to a customer.
Request Body
The Stripe customer ID to assign the card to. Must start with
cus_.Example: "cus_QRs9eKZ4xUzN2TP9"The card token ID obtained from creating a card token. Must start with
tok_.Example: "tok_1QRs9eKZ4xUzN2TP9vQqWXYZ"Response
Indicates if the request was successful (
true) or failed (false).Human-readable message describing the result.Example:
"Tarjeta añadida con éxito"The assigned card information.
Example Request
Example Response
Workflow
The typical workflow for adding a card to a customer:- Tokenize the card - Call Create Card Token with card details
- Assign to customer - Use this endpoint to attach the token to a customer
- Set as default (optional) - Call Set Default Card to make it the default payment method
Example: Complete Card Assignment Flow
Node.js